/* 
接口请求函数模块
*/
import request from './request'

// 登陆
export const reqLogin = (username, pwd) => request.post('/admin/login', {username, pwd})

// 获取用户信息
export const reqInfo = () => request.get('/admin/info')

// 退出登陆
export const reqLogout = () => request.get('/admin/logout')

// 添加用户
export const reqAddUser = (user) => request.post('/admin/user', user)

// 获取用户列表
export const reqGetUsers = (page, limit) => request.get(`/admin/user/${page}/${limit}`)

// 获取用户
export const reqGetUser = (id) => request.get(`/admin/user`, {params: {id}})

// 更新用户
export const reqUpdateUser = (formData) => request.put('/admin/user', formData)

// 删除用户
export const reqDeleteUser = (id) => request.delete(`/admin/user/${id}`)